This folder contains the necessary headers and libraries to do OpenDoc™ development on PowerPC using Metrowerks CodeWarrior.
Compatibility
This stuff is compatible with CodeWarrior 6 and 7 (but see the warning below.) It will probably not work with CodeWarrior 5.5 or earlier, since those use an earlier version of Apple's universal Toolbox headers, and some routine names have changed. You may be able to use earlier versions of CodeWarrior if you replace your universal headers with version 2.1.We have not tried this and don't know if it works. For best results, upgrade to CW6 or CW7.
We have not done any formal testing with CodeWarrior 7, but developers report that it works fine as long as you turn off the C++ language “Exception Support” preference after converting the project (the project conversion will mistakenly turn it on.)
The CFM68K compatible 68K compiler/linker plugins in CW7 are not robust enough yet to build OpenDoc parts. Metrowerks is working on improvements to the compiler, and CW8 (due in January) should support 68K OpenDoc development.
Installation — CW6
1. Copy the “SOM” folder to your “Metrowerks C/C++” folder.
2. Open the “Headers” subfolder of your “Metrowerks C/C++” folder. Move the enclosed “Universal Headers 2.0.1f” folder to the Trash or parenthesize its name. Copy the “Universal Headers 2.1” folder from the “CodeWarrior Additions” folder into your “Headers” folder. The newer headers are neccessary for building the "Cappuccino PPC π" project in the Sample Code folder. (Some of the sample code projects will build with the old headers too.)
You have two choices for step 3:
3a: You can drop the “OpenDoc” folder into your “Metrowerks C/C++” folder. This will make the OpenDoc headers/libraries available to all of your projects. It may slow down CodeWarrior a bit when it searches for header files, since it adds a fair number of files and folders to its search path.
3b: Alternately, you can put the “OpenDoc” folder elsewhere on your disk. You will need to add an access path for the OpenDoc folder to any CodeWarrior project you use for building OpenDoc code. To do this, open the Preferences dialog, select the “Access Paths” panel (it's the bottom one in the list), select the bottom scrolling list, press the “Add” button, and select the “OpenDoc” folder.
Installation — CW7
CodeWarrior 7 comes with headers & libraries for OpenDoc DR3. It's extremely important to remove these before installing the current DR4 headers & libraries, or you will be in a world of hurt. Note that some of the minimal installation options may not have installed these folders, so if you can't find them on your disk, don't worry.
1. Delete these folders from the Metrowerks CodeWarrior: MacOS Support: folder:
Headers:OpenDoc Headers:
Headers:SOM Headers:
Libraries:OpenDoc:
2. We recommend that you download and install the CW7 updates — version 1.3.1 of the IDE and version 1.3.2 of the PPC compiler/linker. These are available from ftp.metrowerks.com and www.metrowerks.com. In particular, there were some problems building ODF parts with the 1.3 compiler.
3. Copy the SOM folder from the same folder as this ReadMe into the folder “Metrowerks CodeWarrior:MacOS Support:Headers:”
4. Open the SOM folder you copied, and move the file “somlib” from it to the folder “Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS Common:”
You have two choices for step 5:
5a: You can drop the “OpenDoc” folder into your “Metrowerks CodeWarrior:MacOS Support:Headers:” folder. This will make the OpenDoc headers/libraries available to all of your projects. It may slow down CodeWarrior a bit when it searches for header files, since it adds a fair number of files and folders to its search path.
5b: Alternately, you can put the “OpenDoc” folder elsewhere on your disk. You will need to add an access path for this folder to any CodeWarrior project you use for building OpenDoc code. To do this, open the Preferences dialog, select the “Access Paths” panel (it's the bottom one in the list), select the bottom scrolling list, press the “Add” button, and select the “OpenDoc” folder.
Installation Tidbits:
* If you will not be writing OpenDoc parts in C, you can save about 2MB of disk space by deleting the “OpenDoc: Interfaces: C” folder. Don't delete the “OpenDoc: Interfaces: CPlusPlus” folder, even if you will only be writing parts in C: the OpenDoc utilities use the files in this folder.
* If the compiler ever has trouble finding OpenDoc headers, verify the access paths of your project.
Important Warning On Project Files
If you create your own project files for building OpenDoc parts, make sure the "Exceptions Support" option in the Language preferences panel is turned on. (In CW6 the "Direct Destruction" option should be turned off.) Otherwise you will run into an incompatibility between the exception-handling utility that comes with OpenDoc (Except.cpp) and CodeWarrior's native exception-handling support, which will cause crashes. If you do not use the Except utility — and there's no reason you have to, it's just a convenience — you can turn on exception support and use native exceptions. Note, however, that this utility is used by other OpenDoc utilities and by all the sample parts.